<template>
    <div>

    </div>
</template>

<script setup>
function deepClone(obj){
    if(obj===null||typeof obj!=='object'){
        return obj;
    }
    if(Array.isArray(obj)){
        return obj.map(deepClone)
    }

    const result={}
    for(const key in obj){
        if(obj.hasOwnProperty(key)){
            result[key] = deepClone(obj[key])
        }
    }
    return result
}
const origin = {a:1,b:{c:2}}
const copy = deepClone(origin)
console.log(copy);
</script>

<style scoped>

</style>